package org.mirrentools.attendance.console.entity;

import io.vertx.core.MultiMap;
import io.vertx.ext.sql.assist.Table;
import io.vertx.ext.sql.assist.TableColumn;
import io.vertx.ext.sql.assist.TableId;
/**
 * 考勤记录表
 * @author 
 */ 
@Table("record")
public class Record {
	/** 记录的id */
	@TableId(value = "id")
	private Long id ; 
	/** 用户的id */
	@TableColumn(value = "uid")
	private String uid ; 
	/** 那一年 */
	@TableColumn(value = "years")
	private Integer years ; 
	/** 那一月 */
	@TableColumn(value = "months")
	private Integer months ; 
	/** 那一日 */
	@TableColumn(value = "days")
	private Integer days ; 
	/** 工作时间 */
	@TableColumn(value = "start")
	private Long start ; 
	/** 休息时间 */
	@TableColumn(value = "end")
	private Long end ; 
	/** 工作时长 */
	@TableColumn(value = "wtime")
	private Integer wtime ; 
	/**id属性在JsonObject中key的名称*/
  public final static String KEY_id = "id";
	/**id属性在table中column的名称*/
  public final static String COL_id = "id";
	/**uid属性在JsonObject中key的名称*/
  public final static String KEY_uid = "uid";
	/**uid属性在table中column的名称*/
  public final static String COL_uid = "uid";
	/**years属性在JsonObject中key的名称*/
  public final static String KEY_years = "years";
	/**years属性在table中column的名称*/
  public final static String COL_years = "years";
	/**months属性在JsonObject中key的名称*/
  public final static String KEY_months = "months";
	/**months属性在table中column的名称*/
  public final static String COL_months = "months";
	/**days属性在JsonObject中key的名称*/
  public final static String KEY_days = "days";
	/**days属性在table中column的名称*/
  public final static String COL_days = "days";
	/**start属性在JsonObject中key的名称*/
  public final static String KEY_start = "start";
	/**start属性在table中column的名称*/
  public final static String COL_start = "start";
	/**end属性在JsonObject中key的名称*/
  public final static String KEY_end = "end";
	/**end属性在table中column的名称*/
  public final static String COL_end = "end";
	/**wtime属性在JsonObject中key的名称*/
  public final static String KEY_wtime = "wtime";
	/**wtime属性在table中column的名称*/
  public final static String COL_wtime = "wtime";
	
	/**
	 * 实例化
	 */
	public Record() {
		super();
	}
	/**
	 * 实例化
	 */
	public Record(MultiMap params) {
		super();
		try {
		if(params.get("id") != null){
			try {
				this.setId(new Long(params.get("id")));
			} catch (Exception e) {
				throw new IllegalArgumentException("无法识别参数:id,请检查是否符合要求!");
			}
		}
		this.setUid(params.get("uid"));
		if(params.get("years") != null){
			try {
				this.setYears(new Integer(params.get("years")));
			} catch (Exception e) {
				throw new IllegalArgumentException("无法识别参数:years,请检查是否符合要求!");
			}
		}
		if(params.get("months") != null){
			try {
				this.setMonths(new Integer(params.get("months")));
			} catch (Exception e) {
				throw new IllegalArgumentException("无法识别参数:months,请检查是否符合要求!");
			}
		}
		if(params.get("days") != null){
			try {
				this.setDays(new Integer(params.get("days")));
			} catch (Exception e) {
				throw new IllegalArgumentException("无法识别参数:days,请检查是否符合要求!");
			}
		}
		if(params.get("start") != null){
			try {
				this.setStart(new Long(params.get("start")));
			} catch (Exception e) {
				throw new IllegalArgumentException("无法识别参数:start,请检查是否符合要求!");
			}
		}
		if(params.get("end") != null){
			try {
				this.setEnd(new Long(params.get("end")));
			} catch (Exception e) {
				throw new IllegalArgumentException("无法识别参数:end,请检查是否符合要求!");
			}
		}
		if(params.get("wtime") != null){
			try {
				this.setWtime(new Integer(params.get("wtime")));
			} catch (Exception e) {
				throw new IllegalArgumentException("无法识别参数:wtime,请检查是否符合要求!");
			}
		}
		} catch (Exception e) {
			throw e;
		}
	}
	
	/**
	 * 获取记录的id
	 * 
	 * @return
	 */
	public Long getId() {
		return id;
	}
	/**
	 * 设置记录的id
	 * 
	 * @param id
	 */
	public Record setId(Long id) {
		this.id = id;
		return this;
	}
	/**
	 * 获取用户的id
	 * 
	 * @return
	 */
	public String getUid() {
		return uid;
	}
	/**
	 * 设置用户的id
	 * 
	 * @param uid
	 */
	public Record setUid(String uid) {
		this.uid = uid;
		return this;
	}
	/**
	 * 获取那一年
	 * 
	 * @return
	 */
	public Integer getYears() {
		return years;
	}
	/**
	 * 设置那一年
	 * 
	 * @param years
	 */
	public Record setYears(Integer years) {
		this.years = years;
		return this;
	}
	/**
	 * 获取那一月
	 * 
	 * @return
	 */
	public Integer getMonths() {
		return months;
	}
	/**
	 * 设置那一月
	 * 
	 * @param months
	 */
	public Record setMonths(Integer months) {
		this.months = months;
		return this;
	}
	/**
	 * 获取那一日
	 * 
	 * @return
	 */
	public Integer getDays() {
		return days;
	}
	/**
	 * 设置那一日
	 * 
	 * @param days
	 */
	public Record setDays(Integer days) {
		this.days = days;
		return this;
	}
	/**
	 * 获取工作时间
	 * 
	 * @return
	 */
	public Long getStart() {
		return start;
	}
	/**
	 * 设置工作时间
	 * 
	 * @param start
	 */
	public Record setStart(Long start) {
		this.start = start;
		return this;
	}
	/**
	 * 获取休息时间
	 * 
	 * @return
	 */
	public Long getEnd() {
		return end;
	}
	/**
	 * 设置休息时间
	 * 
	 * @param end
	 */
	public Record setEnd(Long end) {
		this.end = end;
		return this;
	}
	/**
	 * 获取工作时长
	 * 
	 * @return
	 */
	public Integer getWtime() {
		return wtime;
	}
	/**
	 * 设置工作时长
	 * 
	 * @param wtime
	 */
	public Record setWtime(Integer wtime) {
		this.wtime = wtime;
		return this;
	}

	@Override
	public String toString() {
		return "Record [id=" + id + " , uid=" + uid + " , years=" + years + " , months=" + months + " , days=" + days + " , start=" + start + " , end=" + end + " , wtime=" + wtime + "  ]";
	}
}
